<template>
  <div class="Addbox">
    <!-- 添加商品 -->
    <el-form
      :model="ruleForm"
      :rules="rules"
      ref="ruleForm"
      label-width="100px"
      class="demo-ruleForm"
      @submit.native.prevent
    >
      <!-- 商品分类 -->
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="活动区域" prop="name">
            <el-cascader
              style="min-width: 100%; height: 25px"
              size="medium "
              placeholder="请选择分类"
              v-model="ruleForm.classdata"
              :options="options"
              @change="ClassIfy"
            ></el-cascader>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="SPU标题" prop="SPUname">
            <el-input v-model="ruleForm.SPUname"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- SPU副标题 -->
      <el-row :gutter="20">
        <el-col :span="9">
          <el-form-item label="SPU副标题">
            <el-input v-model="ruleForm.funame"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="3">
          <el-button type="success" icon="el-icon-thumb">应用到SKU</el-button>
        </el-col>
        <el-col :span="12">
          <el-form-item label="销售价格" prop="Price">
            <el-input placeholder="" v-model="ruleForm.Price">
              <template slot="prepend">￥</template>
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 商品品牌 -->
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="商品品牌" prop="region">
            <el-select
              style="min-width: 100%; height: 25px"
              v-model="ruleForm.commodity"
              filterable
              placeholder=""
            >
              <el-option
                v-for="item in commoditydata"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>

            <el-link
              type="primary"
              href="https://element.eleme.io"
              target="_blank"
              >立即去设置</el-link
            >
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="物流模板" prop="region">
            <el-select
              style="min-width: 100%; height: 25px"
              v-model="ruleForm.commodity"
              filterable
              placeholder=""
            >
              <el-option
                v-for="item in commoditydata"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>

            <el-link
              type="primary"
              href="https://element.eleme.io"
              target="_blank"
              >立即去设置</el-link
            >
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 服务支持 -->
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="服务支持">
            <el-checkbox-group v-model="ruleForm.checkList">
              <el-checkbox label="放心购"></el-checkbox>
              <el-checkbox label="7天无理由退换货"></el-checkbox>
              <el-checkbox label="PLUS会员"></el-checkbox>
              <el-checkbox label="211限时达"></el-checkbox>
              <el-checkbox label="免费退换"></el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 是否虚拟商品 -->
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="是否虚拟商品">
            <el-switch
              v-model="ruleForm.virtual"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 是否上架 -->
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="是否上架">
            <el-switch
              v-model="ruleForm.putaway"
              active-color="#13ce66"
              inactive-color="#ff4949"
            >
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- SPU图片 -->
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="SPU图片" prop="img">
            <!-- :limit='5'   上传图片的个数
        :on-exceed='uploadOverrun'  // 判断上传的个数
        :on-preview="handleContImgPreview"   // 点击文件列表中已上传的文件时的钩子
        :on-remove='handleRmove' // 文件列表移除文件时的钩子
        :http-request='submitUpload' // 上传时的请求的接口 
                        :headers=""请求头信息
        -->
            <el-upload
              action="123"
              :http-request="imgupload"
              list-type="picture-card"
              :auto-upload="true"
              :before-upload="beforeUpload_img"
              :on-preview="handlePictureCardPreview"
              :on-remove="handleRemove"
              :limit="5"
              accept="image/png,image/gif,image/jpg,image/jpeg"
              :file-list="ruleForm.PictureArr"
            >
              <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog :visible.sync="SPUImageVisible">
              <img width="100%" :src="SPUImageUrl" alt />
            </el-dialog>
            <el-button
              style="margin-top: 10px"
              type="success"
              icon="el-icon-thumb"
              >应用到SKU</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 视频占位图片 -->

      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="视频占位图片" prop="">
            <el-upload
              class="upload-demo"
              action="上传的地址"
              :http-request="videoImg"
              list-type="picture-card"
              :limit="5"
              :before-upload="beforeUpload_videoImg"
              :on-remove="videoImage_Rmoves"
              :file-list="ruleForm.videoImage"
            >
              <i class="el-icon-plus"></i>
            </el-upload>
            <el-dialog
              :visible.sync="vis_videoImage"
              :append-to-body="true"
              :close-on-click-modal="false"
            >
              <img width="100%" :src="vis_videoImageURL" alt="" />
            </el-dialog>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 介绍视频 -->

      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="介绍视频" prop="">
            <el-upload
              class="upload-demo"
              action="https://jsonplaceholder.typicode.com/posts/"
              :on-change="handleChange"
              :file-list="fileListvd"
            >
              <el-button size="small" type="primary">点击上传视频</el-button>
              <div slot="tip" class="el-upload__tip">
                建议上传mp4(H.264编码)文件，且不超过15M，支持H5，小程序
              </div>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 商品属性 -->
      <el-row :gutter="20" v-if="look">
        <el-col :span="24">
          <el-form-item label="商品属性" prop="property">
            <div
              v-for="domain in ruleForm.property"
              :key="domain.key"
              style="margin:20px 0"
            >
              <el-input
                style="width:300px; "
                v-model="ruleForm.property.propertyName"
                placeholder="请输入属性名"
              ></el-input>
              <el-input
                style="width:300px; margin-left:50px;"
                v-model="ruleForm.property.propertys"
                placeholder="请输入属性值"
              ></el-input>
              <el-button
                style="margin-left:50px;"
                type="danger"
                @click.prevent="removeproperty(domain)"
                >删除属性</el-button
              >
            </div>
          </el-form-item>
          <el-button
            size="medium"
            type="primary"
            style="margin:20px 100px; width:100px"
            @click.prevent="Addproperty"
            >新增属性</el-button
          >
        </el-col>
      </el-row>

      <!-- 规格 -->
      <el-row :gutter="20" v-if="look">
        <el-col :span="24">
          <el-form-item label="规格" prop="specification">
            <div
              v-for="value in ruleForm.specification"
              :key="value.key"
              style="margin:20px 0"
            >
              <el-input
                style="width:300px; "
                v-model="ruleForm.specification.specificationName"
                placeholder="请输入规格名"
              ></el-input>
              <el-input
                style="width:300px; margin-left:50px;"
                v-model="ruleForm.specification.specifications"
                placeholder="请输入规格值"
              ></el-input>
              <el-button
                style="margin-left:50px;"
                type="danger"
                @click.prevent="removespecification(value)"
                >删除规格</el-button
              >
            </div>
          </el-form-item>
          <el-button
            size="medium"
            type="primary"
            style="margin:20px 100px; width:100px"
            @click.prevent="Addspecification"
            >新增规格</el-button
          >
        </el-col>
      </el-row>

      <!-- PC版详情 -->
      <el-row :gutter="20" style="padding-bottom:100px">
        <el-col :span="24">
          <el-form-item label="PC版详情" prop="">
            <!-- 隐藏的上传图片框 -->
            <el-upload
              class="avatar-uploader_box"
              action="上传的地址"
              :http-request="PCimg"
              list-type="picture-card"
              :limit="10"
              :before-upload="beforeUpload_videoImg"
              :on-preview="Pre_videoImg"
              :on-remove="PCImage_Rmoves"
              :file-list="ruleForm.PCImage"
            >
            </el-upload>
            <!-- 富文本 -->
            <quill-editor
              v-model="ruleForm.content"
              ref="myQuillEditor"
              :options="editorOption"
              @blur="onEditorBlur($event)"
              @focus="onEditorFocus($event)"
              @change="onEditorChange($event)"
            >
            </quill-editor>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- 移动版版详情 -->
      <!-- <el-row :gutter="20" style="padding-top: 120px">
        <el-col :span="24">
          <el-form-item label="移动版版详情" prop=""> -->
      <!-- 隐藏的上传图片框 -->
      <!-- <el-upload
              class="avatar-uploader"
              :action="serverUrl"
              name="img"
              :headers="header"
              :show-file-list="false"
              :on-success="uploadSuccess"
              :on-error="uploadError"
              :before-upload="beforeUpload"
            >
            </el-upload> -->
      <!-- 富文本 -->
      <!-- <quill-editor
              v-model="ruleForm.content"
              ref="myQuillEditor"
              :options="editorOption"
              @blur="onEditorBlur($event)"
              @focus="onEditorFocus($event)"
              @change="onEditorChange($event)"
            >
            </quill-editor>
          </el-form-item>
        </el-col>
      </el-row> -->

      <!-- 确认商品 -->
      <el-row :gutter="20">
        <el-col :span="24">
          <el-form-item label="" prop="">
            <el-button type="info"
              ><i class="el-icon-back"></i>返回商品信息列表</el-button
            >
            <el-button type="primary" style="background-color: #58c9f3"
              >发布商品</el-button
            >
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
// 引入富文本

import { quillEditor } from "vue-quill-editor"; //调用编辑器
import * as Quill from "quill"; //引入编辑器
import { ImageDrop } from "quill-image-drop-module";
Quill.register("modules/imageDrop", ImageDrop);

import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";

//获取富文本所以图片的id和被删除图片id

const getRemovImgId = (ids, html) => {
  let dom = document.createElement("div");
  console.log(dom);
  dom.innerHTML = html;
  const imgDom = dom.getElementsByTagName("img");
  // const url = window.location.host;
  const arr = [];
  for (let i = 0; i < imgDom.length; i++) {
    if (imgDom[i]) {
      console.log(imgDom[i]);
      // let reg = /<img[^>]*src=[=\'\"\s]+([^\"\']*)[\"\']?[^>]*>/gi;
      // while (reg.exec(imgDom[i])) {
      //   console.log(RegExp.$1);
      // }  new RegExp("<img[^>]*src=[=\'\"\s]+([^\"\']*)[\"\']?[^>]*>","gi")
      // let  aa = imgDom[i].repalce(new RegExp("<img[^>]*src=[=\'\"\s]+([^\"\']*)[\"\']?[^>]*>","gi"), ' ')
      arr.push(imgDom[i]);
      // let id = unescape(r[2]);
      // ids.splice(ids.indexOf(id), 1);
      // arr.push(id);
    }
    console.log(typeof arr[0]);
  }
  return {
    removeIds: ids,
    imgIds: arr,
  };
};

export default {
  name: "addcommodity",
  props: [""],
  data() {
    return {
      // 表达中的值
      ruleForm: {
        // 商品分类数据
        classdata: "",
        // SPU标题的值
        SPUname: "",
        // SPU副标题
        funame: "",
        // 销售价格
        price: "",
        // 商品品牌
        commodity: "",
        // 单选框
        checkList: [],
        // 是否虚拟商品
        virtual: "",
        // 是否上架
        putaway: "",
        // PC富文本
        content: "",
        // 图片数据
        PictureArr: [],
        // 商品图片数据
        videoImage: [],
        // PC富文本图片
        PCImage: [],
        // 属性值
        property: [
          {
            propertyName: "",
            propertys: "",
          },
        ],
        // 规格
        specification: [
          {
            specificationName: "",
            specifications: "",
          },
        ],
      },
      // 表单校验规则
      rules: {
        // SPU标题验证
        SPUname: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          {
            min: 3,
            max: 20,
            message: "长度在 3 到 20 个字符",
            trigger: "blur",
          },
        ],
        // 金额验证
        Price: [
          { required: true, message: "请输入合法的金额", trigger: "blur" },
          { min: 1, max: 5, message: "长度在 3 到 10 个字符", trigger: "blur" },
        ],
        region: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        img: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
          { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
        ],
        // 商品属性
        property: [
          { required: true, message: "请输入商品属性", trigger: "blur" },
          {
            min: 1,
            max: 100,
            message: "请输入商品属性",
            trigger: ["blur", "change"],
          },
        ],
        // 商品规格
        specification: [
          { required: true, message: "请输入商品规格", trigger: "blur" },
          {
            min: 1,
            max: 100,
            message: "请输入商品规格",
            trigger: ["blur", "change"],
          },
        ],
      },
      // 商品分类数据
      options: [
        {
          value: "zhinan",
          label: "指南",
          children: [
            {
              value: "shejiyuanze",
              label: "设计原则",
              children: [
                {
                  value: "yizhi",
                  label: "一致",
                },
                {
                  value: "fankui",
                  label: "反馈",
                },
                {
                  value: "xiaolv",
                  label: "效率",
                },
                {
                  value: "kekong",
                  label: "可控",
                },
              ],
            },
            {
              value: "daohang",
              label: "导航",
              children: [
                {
                  value: "cexiangdaohang",
                  label: "侧向导航",
                },
                {
                  value: "dingbudaohang",
                  label: "顶部导航",
                },
              ],
            },
          ],
        },
      ],
      // 商品品牌数据
      commoditydata: [
        {
          value: "zhinan",
          label: "指南",
          children: [
            {
              value: "shejiyuanze",
              label: "设计原则",
              children: [
                {
                  value: "yizhi",
                  label: "一致",
                },
                {
                  value: "fankui",
                  label: "反馈",
                },
                {
                  value: "xiaolv",
                  label: "效率",
                },
                {
                  value: "kekong",
                  label: "可控",
                },
              ],
            },
            {
              value: "daohang",
              label: "导航",
              children: [
                {
                  value: "cexiangdaohang",
                  label: "侧向导航",
                },
                {
                  value: "dingbudaohang",
                  label: "顶部导航",
                },
              ],
            },
          ],
        },
      ],
      // 图片数据
      SPUImageVisible: false,
      SPUImageUrl: "",
      // 视频图片
      vis_videoImageURL: "",
      vis_videoImage: false,
      // 上传视频
      fileListvd: [],
      editorOption: {
        placeholder: "请在这里输入",
        modules: {
          clipboard: {
            // 粘贴版，处理粘贴时候的自带样式
            matchers: [[Node.ELEMENT_NODE, this.HandleCustomMatcher]],
          },
          toolbar: {
            container: [
              ["bold", "italic", "underline", "strike"], //加粗，斜体，下划线，删除线
              ["blockquote", "code-block"], //引用，代码块
              [{ header: 1 }, { header: 2 }], // 标题，键值对的形式；1、2表示字体大小
              [{ list: "ordered" }, { list: "bullet" }], //列表
              [{ script: "sub" }, { script: "super" }], // 上下标
              [{ indent: "-1" }, { indent: "+1" }], // 缩进
              [{ direction: "rtl" }], // 文本方向
              [{ size: ["small", false, "large", "huge"] }], // 字体大小
              [{ header: [1, 2, 3, 4, 5, 6, false] }], //几级标题
              [
                {
                  color: [],
                },
                {
                  background: [],
                },
              ], // 字体颜色、字体背景颜色
              [{ font: [] }], //字体
              [{ align: [] }], //对齐方式
              ["clean"], //清除字体样式
              ["link", "image"], //上传图片、上传视频
            ],
            handlers: {
              image: function(value) {
                if (value) {
                  // 触发input框选择图片文件
                  document.querySelector(".avatar-uploader_box input").click();
                } else {
                  this.quill.format("image", false);
                }
              },
            },
          },
          imageDrop: true,
        },
      },
      // 上传隐藏图片地址
      serverUrl: "",
      dialogImageUrl: "",
      // 上传隐藏图片请求头
      header: {},
      quillUpdateImg: false, // 根据图片上传状态来确定是否显示loading动画，刚开始是false,不显示
      // 富文本
      content: "",
      imgIds: [], //所有图片id
      removeIds: [], //被删除图片id
      // 商品规格显示与隐藏
      look:false
    };
  },

  components: {
    // 注册富文本
    quillEditor,
  },

  computed: {
    editor() {
      return this.$refs.myQuillEditor.quill;
    },
  },

  beforeMount() {},

  mounted() {},

  methods: {
    // 商品分类
    ClassIfy(value) {
      if(value){
        this.look=true
      }
    },

    // 上传图片的时候发生的事件
    beforeUpload_img(file) {
      // console.log(file, 99);
    },
    // 点图片时触发的事件
    handlePictureCardPreview(file) {
      this.SPUImageUrl = file.url;
      this.SPUImageVisible = true;
    },
    // 点击图片时删除的事件
    handleRemove(file, fileList) {
      try {
        // 删除图片发送请求
        request.DelImg(file.url).then((res) => {
          if (res.data.code == 200) {
            // 真正删除图片
            let newDate = this.ruleForm.PictureArr.filter(
              (value) => value.uid !== file.uid
            );
            this.ruleForm.PictureArr = newDate;
            this.$message.success("成功删除");
          } else {
            this.$message.error("删除失败，请重新删除");
          }
        });
      } catch {
        this.$message.error("删除失败，请重新删除");
      }
    },
    // 上传相片
    imgupload(param) {
      // console.log(param, 111);
      let formDate = new FormData();
      formDate.append("file", param.file);
      // let config = {
      //   headers: {
      //     "Content-Type": "multipart/form-data",
      //   },
      // };
      // request.post('/goods/oss/uploadImg',formDate,config).then(res=>{
      //   console.log(res.data);
      // })
      try {
        request
          .Img(formDate)
          .then((res) => {
            // console.log(res.data,9999);
            if (res.data.code == 200) {
              let obj = { url: res.data.data, uid: res.data.uid };
              this.ruleForm.PictureArr.push(obj);
              this.$message.success("上传成功");
            } else {
              this.$message.error("上传失败");
            }
          })
          .catch((err) => {
            this.$message.error("上传失败");
          });
      } catch {
        this.$message.error("上传失败");
      }
    },
    // 上传视频图片请求
    videoImg(param) {
      let formDate = new FormData();
      formDate.append("file", param.file);
      try {
        request
          .Img(formDate)
          .then((res) => {
            // console.log(res.data,9999);
            if (res.data.code == 200) {
              let obj = { url: res.data.data, uid: res.data.uid };
              this.ruleForm.videoImage.push(obj);
              this.$message.success("上传成功");
            } else {
              this.$message.error("上传失败");
            }
          })
          .catch((err) => {
            this.$message.error("上传失败");
          });
      } catch {
        this.$message.error("上传失败");
      }
    },
    // 上传视频图片触发的事件
    beforeUpload_videoImg(file) {},
    // 视频图片文件列表移除文件时的钩子
    videoImage_Rmoves(file, fileList) {
      try {
        // 删除图片发送请求
        request.DelImg(file.url).then((res) => {
          if (res.data.code == 200) {
            // 真正删除图片
            let newDate = this.ruleForm.PictureArr.filter(
              (value) => value.uid !== file.uid
            );
            this.ruleForm.PictureArr = newDate;
            this.$message.success("成功删除");
          } else {
            this.$message.error("删除失败，请重新删除");
          }
        });
      } catch {
        this.$message.error("删除失败，请重新删除");
      }
    },
    // 视频图片点击放大镜的时候出现的事件
    Pre_videoImg(file) {
      // console.log(file);
      this.vis_videoImageURL = file.url;
      this.vis_videoImage = true;
    },

    // 上传视频
    handleChange(file, fileList) {
      this.fileListvd = fileList.slice(-3);
    },
    // 删除商品属性按钮
    removeproperty(item) {
      var index = this.ruleForm.property.indexOf(item);
      if (index !== -1) {
        this.ruleForm.property.splice(index, 1);
      }
    },
    // 新增商品属性按钮
    Addproperty() {
      this.ruleForm.property.push({
        propertyName: "",
        propertys: "",
        key: Date.now(),
      });
    },
    // 删除规格
    removespecification(item) {
      var index = this.ruleForm.specification.indexOf(item);
      if (index !== -1) {
        this.ruleForm.specification.splice(index, 1);
      }
    },
    // 新增规格
    Addspecification() {
      this.ruleForm.specification.push({
        specificationName: "",
        specifications: "",
        key: Date.now(),
      });
    },

    onEditorReady(editor) {
      // 准备编辑器
    },
    // 富文本
    onEditorBlur(a) {}, // 失去焦点事件
    onEditorFocus(a, b, c) {
      // console.log(a.editor.delta);
    }, // 获得焦点事件
    onEditorChange({ editor, html, text }) {
      this.ruleForm.content = html;
      this.content = html;
      const ids = getRemovImgId(this.imgIds, html);
      this.imgIds = ids.imgIds;
      this.removeIds = [...this.removeIds, ...ids.removeIds];
      console.log(this.imgIds);
      console.log(this.removeIds);
    }, // 内容改变事件
    // PC富文本
    HandleCustomMatcher(node, Delta) {
      // 文字、图片等，从别处复制而来，清除自带样式，转为纯文本
      let ops = [];
      Delta.ops.forEach((op) => {
        if (op.insert && typeof op.insert === "string") {
          ops.push({
            insert: op.insert,
          });
        }
      });
      Delta.ops = ops;
      return Delta;
    },

    // 上传隐藏图片成功回调函数
    uploadSuccess(response, file, fileList) {
      // res为图片服务器返回的数据
      // 获取富文本组件实例
      console.log(response);
      let quill = this.$refs.myQuillEditor.quill;
      // 如果上传成功
      if (response.code == 200) {
        // 获取光标所在位置
        let length = quill.getSelection().index;
        // 插入图片  res.url为服务器返回的图片地址
        quill.insertEmbed(length, "image", response.data.url);
        // 调整光标到最后
        quill.setSelection(length + 1);
      } else {
        this.$message.error("图片插入失败");
      }
      // loading动画消失
      console.log(fileList);
      // this.fileList = fileList
      this.quillUpdateImg = false;
    },
    // 上传隐藏图片失败回调函数
    uploadError() {
      // loading动画消失
      this.quillUpdateImg = false;
      this.$message.error("图片插入失败");
    },
    // 上传隐藏图片上传时
    beforeUpload() {
      // 显示loading动画
      this.quillUpdateImg = true;
    },
    // 上传PC图片
    PCimg(param) {
      // console.log(param, 111);
      let quill = this.$refs.myQuillEditor.quill;
      let formDate = new FormData();
      formDate.append("file", param.file);
      try {
        request
          .Img(formDate)
          .then((res) => {
            // console.log(res.data,9999);
            if (res.data.code == 200) {
              let obj = { url: res.data.data, uid: res.data.uid };
              this.ruleForm.PCImage.push(obj);
              this.$message.success("上传成功");
              let length = quill.getSelection().index;
              quill.insertEmbed(length, "image", obj.url);
              quill.setSelection(length + 1);
            } else {
              this.$message.error("上传失败");
            }
          })
          .catch((err) => {
            this.$message.error("上传失败");
          });
      } catch {
        this.$message.error("上传失败");
      }
    },
    // PC上传PC图片删除
    PCImage_Rmoves() {},
  },
  watch: {
    // 监听富文本内容
    // content(value, Ova) {
    //   let reg = /<img[^>]*src=[=\'\"\s]+([^\"\']*)[\"\']?[^>]*>/gi;
    //   while (reg.exec(value)) {
    //     this.newImg.push(RegExp.$1)
    //   }
    //   while (reg.exec(Ova)) {
    //     this.OrImg = RegExp.$1
    //   }
    // },
  },
};
// 引入接口
import request from "../../api/goodsAPI";
</script>
<style lang="scss" scoped>
@import url("./fuwenben.css");
.el-form-item {
  font-weight: bold !important;
}
.Addbox {
  width: 100vh;
  height: 100%;
}
.avatar-uploader_box {
  display: none;
}
</style>
